package com.tieto.springboot.demo.customsession;

import java.util.concurrent.TimeUnit;

import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;

/**
 * implements by GUAVA local cache from google, use to store session object in
 * it and avoid create more session objects when create
 * CustomHttpServletRequestWrapper
 * 
 * @author tannnpen
 *
 */
public final class LocalCache {

	private LocalCache() {
	}

	private static final Cache<String, CustomSession> sessionCache = CacheBuilder.newBuilder()
			.expireAfterAccess(30, TimeUnit.MINUTES).build();

	public static final Cache<String, CustomSession> getSessionCache() {
		return sessionCache;
	}
}
